package com.smartystars.liegestuetze;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Main extends Activity {
	public int counter = 0;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		final Button cmdCount = (Button) findViewById(R.id.cmdCounter);
        cmdCount.setOnClickListener(new View.OnClickListener() {
        	public void onClick(View v) {
        		count();
        	}
        });
	}
	
	public void count() {
		
		TextView lblCounter = (TextView)findViewById(R.id.lblCounter);
		counter += 1;
		
		lblCounter.setText(String.valueOf(counter));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
